package com.caidanxiaoyuan.controller;

import java.sql.Time;
import java.sql.Timestamp;
import java.util.Date;

import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.chainsaw.Main;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;

import com.caidanxiaoyuan.util.ResponseUtil;

@Controller
@CrossOrigin
@RequestMapping("/time")
public class TimeController {

	@RequestMapping("/")
	public void time(HttpServletResponse response){
		try {
			ResponseUtil.write(response,Long.parseLong(String.valueOf(System.currentTimeMillis()).toString().substring(0,10)));
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
}
